<?php  echo $javascript->link(array('tab','ckeditor/ckeditor','ckeditor/adapters/jquery'));?>
<script>

$(document).ready(function() {
 $('#add').click(function() {
  return !$('#select1 option:selected').remove().appendTo('#select2');
 });
 $('#remove').click(function() {
  return !$('#select2 option:selected').remove().appendTo('#select1');
 });    

});


</script>
<style>
      select {
   width: 254px;
   height: 300px;
  }
</style>
<?php
//$subscriber=array_merge($subscriber,$subscrib);
echo $this->Form->create('Newsletter',array('action'=>'send'));
?>




 <h2>Send Newsletters</h2>   
  <table id="table" width="900px" cellpadding="5" cellspacing="5">
    <tr align="center">
        <td>
            <table width="100%" style="margin-left:50px;">
                <tr>
                    <td>Newsletter's Subscriber</td>
                    <td>Send Newsletter To</td>
                </tr>
                <tr>
                    <td>
                        <table border="0">
                                <td width="75%" align="right" >
                                    <select multiple="multiple" size="15" id="select1">
                                       <?php foreach($email as $emails){ ?>
                                       <option value="<?php echo $emails; ?>"><?php echo $emails;?></option>
                                       <?php } ?>
                                     </select>
                   
                                 </td>
                                  <td align="right"><a href="#" id="add">add &gt;&gt;</a>  </td>
                                 </tr>
                        </table> 
                    </td>
                    <td>
                        <table border="0">
                         <tr>
                            <td width="10%" >  <a href="#" id="remove">&lt;&lt; remove</a></td>
                            <td width="50%"  >
                            <?php echo $this->Form->input('emails',array('label'=>'','multiple'=>'multiple','options'=>'','size'=>'15','id'=>'select2')) ?>
                            </td>
                         </tr>
                       </table>
                    </td>
                </tr>
            </table>
            <hr></hr>
            <table cellpadding="10" cellspacing="10">
                <tr>
                    <td id="label" >Newsletter Title</td>
                    <td><?php echo $this->Form->input('title', array('label' => '','size'=>'50')); ?></td>
                </tr>                
                <tr>
                    <td id="label"  >Description</td>
                    <td><?php echo $this->Form->textarea('msg',array('label'=>'','rows'=>'10','cols'=>'100','class'=>'ckeditor')) ?> </td>
                </tr>                
                
                    
                
                
                <tr><td></td><td></td></tr>
            </table>
<?php echo $this->Form->end('Send'); ?>
        </td>
    </tr>
</table>
























